#ifndef __PLATFORM_ODATA_H__
#define __PLATFORM_ODATA_H__

#include "platform/oTypes.h"

class oGroup;

namespace platform
{
	class oUnit;

	class oDLL oData
	{
	public:
		void setRelation(uint32 groupIndexA, uint32 groupIndexB, oRelation relation);
		void setRelation(oGroup* groupA, oGroup* groupB, oRelation relation);
		oRelation getRelation(oGroup* groupA, oGroup* groupB) const;
		oRelation getRelation(oUnit* unitA, oUnit* unitB) const;
		PROPERTY_READONLY(oGroup*, SensePlayerGroup);
		PROPERTY_READONLY(oGroup*, TerrainGroup);
		PROPERTY_READONLY(oGroup*, SenseAllGroup);
		void setDamageFactor(oDamageType damageType, oDefenceType defenceType, float bounus);
		float getDamageFactor(oDamageType damageType, oDefenceType defenceType) const;
		bool isPlayerUnit(oBody* body);
		bool isTerrain(oBody* body);
		static oData& sharedData();
	protected:
		oData();
	private:
		unordered_map<uint32, oRelation> _relationMap;
		unordered_map<uint32, float> _damageBounusMap;
	};

#define oSharedData oData::sharedData()
}

#endif